home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / program / libkb100.zip / LIBKB-1.00 / CONFIG / DOS / MAKEFILE.DJ2 < prev    next >
Text File  |  1996-07-23  |  3KB  |  149 lines

  1. #
  2. # libkb -- a free, advanced and portable low-level keyboard library
  3. # Copyright (C) 1995, 1996 Markus Franz Xaver Johannes Oberhumer
  4. # For conditions of distribution and use, see copyright notice in kb.h 
  5. #
  6.  
  7. #
  8. # Makefile for djgpp v2 using GNU Make 3.73
  9. # type 'make -f makefile.dj2'
  10. #
  11.  
  12.  
  13. ifeq ($(strip $(shell_@)),)
  14. shell_@=$(subst /,\\,$@)
  15. endif
  16.  
  17.  
  18. # /***********************************************************************
  19. # // directories
  20. # ************************************************************************/
  21.  
  22. SRCDIR = include;src;samples
  23.  
  24. vpath %.c     $(SRCDIR)
  25. vpath %.cc    $(SRCDIR)
  26. vpath %.cpp   $(SRCDIR)
  27. vpath %.h     $(SRCDIR)
  28. vpath %.hh    $(SRCDIR)
  29. vpath %.pl    $(SRCDIR)
  30.  
  31.  
  32. # /***********************************************************************
  33. # // settings
  34. # ************************************************************************/
  35.  
  36. ifeq ($(target),)
  37.   target=djgpp2
  38. endif
  39.  
  40. O = .o#        # object extension
  41. A = .a#        # library extension
  42. ifeq ($(target),djgpp1)
  43. E = .out#    # executable extension
  44. else
  45. E = .exe#    # executable extension
  46. endif
  47.  
  48. ifeq ($(target),emx)
  49. LIBKB = kb$(A)            # name of the library
  50. else
  51. LIBKB = libkb$(A)        # name of the library
  52. endif
  53.  
  54. CC = gcc
  55. # optimize, all warnings
  56. # there are some rumors that '-fomit-frame-pointer' causes problems 
  57. # in a Windows DOS box, so I don't use it here
  58. CFLAGS = -O2 -Wall -W -Iinclude -Isrc
  59. ## CFLAGS += -DKB_DEBUG=4 
  60. LDFLAGS = -s
  61.  
  62.  
  63. # /***********************************************************************
  64. # // compiler targets
  65. # ************************************************************************/
  66.  
  67. # djgpp v2 
  68. ifeq ($(target),djgpp2)
  69.   TUBE_LDLIBS += -lemu
  70. endif
  71.  
  72. # djgpp v2 + MikMod
  73. ifeq ($(target),djgpp2_mik)
  74.   CFLAGS += -DUSE_MIKMOD
  75.   TUBE_LDLIBS += -lmik -lemu
  76. endif
  77.  
  78. # djgpp v2 + sb_lib
  79. ifeq ($(target),djgpp2_sb)
  80.   CFLAGS += -DUSE_SB_LIB
  81.   TUBE_LDLIBS += -lsb -lemu
  82. endif
  83.  
  84. # djgpp v2 + Allegro + MikMod
  85. ifeq ($(target),djgpp2_allegro)
  86.   CFLAGS += -DUSE_ALLEGRO
  87.   CFLAGS += -DUSE_MIKMOD
  88.   TUBE_LDLIBS += -lalleg -lmik -lemu
  89. endif
  90.  
  91. # djgpp v1
  92. ifeq ($(target),djgpp1)
  93.   LDLIBS += -lpc
  94.   TUBE_LDLIBS += -lm
  95.   LD_SPECIAL = coff2exe $@
  96. endif
  97.  
  98. # emx
  99. ifeq ($(target),emx)
  100.   KBTST_LDLIBS += -lvideo -lm
  101.   LD_SPECIAL = emxbind -aq $@ -acim
  102. endif
  103.  
  104.  
  105. # /***********************************************************************
  106. # // 
  107. # ************************************************************************/
  108.  
  109. default: all
  110.  
  111. include makefile.inc
  112.  
  113.  
  114. all: $(LIBKB) kbtst$(E) simple$(E) keycodes$(E) tube$(E) sigalrm$(E)
  115.  
  116. kbtst$(E): kbtst$(O) $(LIBKB)
  117.     $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) $(KBTST_LDLIBS) -o $@
  118.     $(LD_SPECIAL)
  119.  
  120. simple$(E): simple$(O) $(LIBKB)
  121.     $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
  122.     $(LD_SPECIAL)
  123.  
  124. sigalrm$(E): sigalrm$(O) $(LIBKB)
  125.     $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
  126.     $(LD_SPECIAL)
  127.  
  128. keycodes$(E): keycodes$(O) $(LIBKB)
  129.     $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
  130.     $(LD_SPECIAL)
  131.  
  132. tube$(E): tube$(O) $(LIBKB)
  133.     $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) $(TUBE_LDLIBS) -o $@
  134.     $(LD_SPECIAL)
  135.  
  136. $(LIBKB): $(OBJS)
  137.     +del $(LIBKB)
  138.     ar -rcs $(LIBKB) $^
  139.  
  140.  
  141. # other rules
  142.  
  143. _kbname.hh: mkkbname.pl kb.h
  144.     perl -w $^ > $(shell_@)
  145.  
  146. mktables$E: mktables$O
  147.     $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
  148.  
  149.